home *** CD-ROM | disk | FTP | other *** search
Text File | 2003-07-17 | 29.8 KB | 1,111 lines |
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- //
- // Alias|Wavefront Script File
- // MODIFY THIS AT YOUR OWN RISK
- //
- // Creation Date: Jan 2000
- //
- // Description:
- // The procedures in this file are used to update (set the
- // correct values for) the UI controls in the Preferences
- // window. The updates should be done from the pref
- // optionVars to make the window work correctly after a
- // reset or revert to factory settings.
- //
- // Note: If adding preferences, make sure to read
- // http://w3.tor.aw.sgi.com/maya/TechDoc/CodingGuides/addingPreferences.html
- //
-
- global proc prefsUpdate()
- {
- prefsUpdateAppearance();
- prefsUpdateElements();
- prefsUpdateWindows();
- prefsUpdateDisplay();
- prefsUpdateKin();
- prefsUpdateAnimDisplay();
- prefsUpdateManips();
- prefsUpdateNURBS();
- prefsUpdatePolys();
- prefsUpdateSettings();
- prefsUpdateAnim();
- prefsUpdateDyn();
- prefsUpdateKeys();
- prefsUpdateModeling();
- prefsUpdateSelect();
- prefsUpdateSnap();
- prefsUpdateSound();
- prefsUpdateAdvanced();
- prefsUpdateRendering();
- prefsUpdateFileIO();
- prefsUpdateModules();
- prefsUpdateOpenMaya();
- }
-
- global proc prefsUpdateAppearance()
- {
- global string $gPreferenceWindow;
- global string $gMainWindow;
- global string $gCommandWindow;
- global string $gMayaMode;
-
- setParent $gPreferenceWindow;
- string $parent = "prefAppearCol";
- if (`columnLayout -q -numberOfChildren $parent` == 0) return;
-
- string $prefMode = `optionVar -q mayaMode`;
-
- if ("Animation" == $prefMode) {
- optionMenuGrp -e -sl 1 modeOpts;
- } else if ("Modeling" == $gMayaMode) {
- optionMenuGrp -e -sl 2 modeOpts;
- } else if ("Dynamics" == $gMayaMode) {
- optionMenuGrp -e -sl 3 modeOpts;
- } else if ("Rendering" == $gMayaMode) {
- optionMenuGrp -e -sl 4 modeOpts;
- } else if ("dynamics" == $prefMode) {
- optionMenuGrp -e -sl 5 modeOpts;
- } else if ("rendering" == $prefMode) {
- optionMenuGrp -e -sl 6 modeOpts;
- } else {
- optionMenuGrp -e -sl 1 modeOpts;
- }
-
- checkBoxGrp -e
- -value1 `optionVar -query mainWindowMenubarVis`
- mainMenubarCheck1;
-
- checkBoxGrp -e
- -value1 `optionVar -query allowMenusInPanels`
- showMenuBarChk;
-
- checkBoxGrp -e
- -value1 `optionVar -query mainWindowTitleBarVis`
- mainTitleCheck1;
-
- checkBoxGrp -e
- -value1 `optionVar -query cmdWindowTitleBarVis`
- cmdTitleCheck1;
-
- checkBoxGrp -e
- -value1 `optionVar -query saveWindowPos`
- winPrefChk;
-
- checkBoxGrp -e
- -value1 `optionVar -query commandLineHoldFocus`
- focusCheck;
-
- if( `optionVar -q aeInMainWindow` ) {
- radioButtonGrp -edit -sl 1 aeInWindowPrefChk2;
- } else {
- radioButtonGrp -edit -sl 1 aeInWindowPrefChk1;
- }
-
- if (`optionVar -query toolSettingsInMainWindow`) {
- radioButtonGrp -edit -select 1 toolSettingsInWindowPrefChk2;
- } else {
- radioButtonGrp -edit -select 1 toolSettingsInWindowPrefChk1;
- }
-
- optionMenuGrp -e
- -sl `optionVar -q EEexprEdTextEditor`
- textEdOpts;
-
- prefExprEdTextEditor(1);
-
- if( `about -mac` ) {
- radioButtonGrp -e -sl `optionVar -q mayaMacButtonMap` mouseTracking;
- }
- }
-
-
- global proc prefsUpdateElements()
- {
- global string $gPreferenceWindow;
- setParent $gPreferenceWindow;
- string $parent = "prefElementsCol";
- if (`columnLayout -query -numberOfChildren $parent` == 0) return;
-
- checkBoxGrp -edit
- -value1 `optionVar -query statusLineVisible`
- statusLineCheckBox;
-
- checkBoxGrp -edit
- -value1 `optionVar -query isShelfVisible`
- shelfCheckBox;
-
- checkBoxGrp -edit
- -value1 `optionVar -query timeSliderVisible`
- timeSliderCheckBox;
-
- checkBoxGrp -edit
- -value1 `optionVar -query playbackRangeVisible`
- playbackRangeCheckBox;
-
- checkBoxGrp -edit
- -value1 `optionVar -query commandLineVisible`
- commandLineCheckBox;
-
- checkBoxGrp -edit
- -value1 `optionVar -query helpLineVisible`
- helpLineCheckBox;
-
- checkBoxGrp -edit
- -value1 `optionVar -query toolboxVisible`
- toolboxCheckBox;
-
- checkBoxGrp -edit
- -value1 `optionVar -query isAttributeEditorVisible`
- attributeEditorCheckBox;
-
- checkBoxGrp -edit
- -value1 `optionVar -query toolSettingsVisible`
- toolSettingsCheckBox;
-
- checkBoxGrp -edit
- -value1 `optionVar -query channelsLayersVisible`
- channelsLayersCheckBox;
- }
-
- global proc prefsUpdateWindows()
- {
- global string $gPreferenceWindow;
- global int $gRaiseHelpBrowserWin;
- global string $gHelpLanguage;
- global string $gNewScenePanelConfig;
- global int $gUseNewScenePanelConfig;
- global int $gUseScenePanelConfig;
- global int $gUseSaveScenePanelConfig;
-
- setParent $gPreferenceWindow;
- string $parent = "prefWindowsCol";
- if (`columnLayout -q -numberOfChildren $parent` == 0) return;
-
- //
- // Help
- //
- intFieldGrp -edit
- -value1 `optionVar -query helpPopupDisplayTime`
- popupHelpTime;
-
- // This UI removed in Maya 5.0.
- //
- // if (`optionVar -q helpBrowserUseWindow`) {
- // radioButtonGrp -e -sl 1 winRBG;
- // } else {
- // radioButtonGrp -e -sl 1 winRBG2;
- // }
- //
- // checkBoxGrp -e
- // -value1 `optionVar -query helpBrowserRaiseWindow` visCBG;
-
- // Functionality removed before Maya 4.0 shipped.
- // Needs better integration before being resurrected.
- //
- // if (`about -nt`) {
- // if( `optionVar -q helpInMainWindow` ) {
- // radioButtonGrp -edit -sl 1 helpInWindowPrefChk2;
- // } else {
- // radioButtonGrp -edit -sl 1 helpInWindowPrefChk1;
- // }
- // }
-
- string $language = `optionVar -q helpLanguage`;
- if ($language == "en_US") {
- radioButtonGrp -e -select 1 helpLanguageEnglish;
- textFieldGrp -e -enable false helpLanguageSpecify;
- } else if ($language == "ja_JP"){
- radioButtonGrp -e -select 1 helpLanguageJapanese;
- textFieldGrp -e -enable false helpLanguageSpecify;
- } else {
- radioButtonGrp -e -select 1 helpLanguageOther;
- textFieldGrp -e -enable true helpLanguageSpecify;
- }
-
- textFieldGrp -edit
- -text `optionVar -q helpLanguage`
- helpLanguageSpecify;
-
- // If MAYA_HELP_URL env var is set, we won't allow
- // this to be set from the UI
- string $envVar = `getenv MAYA_HELP_URL`;
- if ( size($envVar) > 0 ) {
- radioButtonGrp -edit -enable false helpLocationLocal;
- radioButtonGrp -edit -enable false helpLocationRemote;
- textFieldGrp -edit -text $envVar -enable false helpUrlField;
- } else {
- string $location = `optionVar -q helpUrl`;
- if (size($location) == 0) {
- radioButtonGrp -e -select 1 helpLocationLocal;
- textFieldGrp -e -enable false helpUrlField;
- } else {
- radioButtonGrp -e -select 1 helpLocationRemote;
- textFieldGrp -e -enable true helpUrlField;
- }
- textFieldGrp -edit -text `optionVar -q remoteHelpUrl` helpUrlField;
- }
-
- //
- // Scene config
- //
- int $i, $nItems, $nConfigs;
- int $count = 0;
- string $currSelect, $config;
- string $configs[] = `getPanel -allConfigs`;
- string $items[];
-
- //
- // update menu items.
- //
-
- // This is a fix to get around the optionMenuGrp bug (#81337)
- string $fullName = `setParent "configOpts"`;
- string $menuName = ($fullName+"|OptionMenu");
- setParent -m $menuName;
-
- $currSelect = $gNewScenePanelConfig;
- $configs = `getPanel -allConfigs`;
- $nConfigs = size($configs);
- $items = `optionMenuGrp -q -ill configOpts`;
- $nItems = `optionMenuGrp -q -ni configOpts`;
- $count = 0;
- for ($i = 0; $i < $nConfigs; $i++) {
- if (!`panelConfiguration -q -sc $configs[$i]` &&
- "Current Layout" != `panelConfiguration -q -l $configs[$i]`)
- {
- if ($count < $nItems) {
- menuItem -e -l `panelConfiguration -q -l $configs[$i]` $items[$count];
- } else {
- menuItem -l `panelConfiguration -q -l $configs[$i]`;
- }
- $count++;
- }
- }
- // remove any extra items
- for ($i = $count; $i < $nItems; $i++) {
- deleteUI -menuItem $items[$i];
- }
-
- checkBoxGrp -edit
- -value1 `optionVar -query useSaveScenePanelConfig`
- saveConfig;
-
- checkBoxGrp -edit
- -value1 `optionVar -query useScenePanelConfig`
- openConfig;
-
- if (`optionVar -q "useNewScenePanelConfig"`) {
- radioButtonGrp -e -sl 1 newConfig2;
- } else {
- radioButtonGrp -e -sl 1 newConfig1;
- }
-
- $count = 0;
- $currSelect = `optionVar -q "newScenePanelConfiguration"`;
- for ($config in $configs) {
- if (!`panelConfiguration -q -sc $config` &&
- "Current Layout" != `panelConfiguration -q -l $config`)
- {
- $count++;
- if ($currSelect == `panelConfiguration -q -l $config`) {
- optionMenuGrp -e -sl $count configOpts;
- break;
- }
- }
- }
- }
-
- global proc prefsUpdateDisplay()
- {
- global string $gPreferenceWindow;
- setParent $gPreferenceWindow;
- string $parent = "prefDisplayCol";
- if (`columnLayout -q -numberOfChildren $parent` == 0) return;
-
- radioButtonGrp -e
- -sl (`optionVar -q fastInteraction` ? 1 : 2) fastRBG;
-
- checkBoxGrp -edit
- -value1 `optionVar -query viewAxisVisibility` axisCBG;
- checkBoxGrp -edit
- -value2 `optionVar -query toggleOriginAxis` axisCBG;
- radioButtonGrp -e
- -sl (`optionVar -q showGrid` ? 1 : 2) gridRBG;
- radioButtonGrp -e
- -sl (`optionVar -q activeObjectPivots` ? 1 : 2) activeObjectPivotsRBG;
- radioButtonGrp -e
- -sl (`optionVar -q displayAffected` ? 1 : 2) affectedRBG;
- radioButtonGrp -e
- -sl (`optionVar -q displayRegionOfEffect` ? 1 : 2) regionOfEffectRBG;
- radioButtonGrp -e
- -sl `optionVar -q wireframeOnShadedActive` wireframeOnShadedActiveRBG;
- radioButtonGrp -e
- -sl (`optionVar -q shadeTemplates` ? 1 : 2) shadeTemplatesRBG;
- }
-
- global proc prefsUpdateKin()
- {
- global string $gPreferenceWindow;
- setParent $gPreferenceWindow;
- string $parent = "prefKinCol";
- if (`columnLayout -q -numberOfChildren $parent` == 0) return;
-
- floatSliderGrp -e
- -v (`optionVar -q ikJointDisplayScale`) jdsPrefWidget;
- floatSliderGrp -e
- -v (`optionVar -q ikIkFkJointDisplayScale`) jdsIkFkPrefWidget;
- floatSliderGrp -e
- -v (`optionVar -q ikHandleDisplayScale`) hdsPrefWidget;
-
- int $dm = 4;
- string $display = `optionVar -q ikIkFkDisplayMethod`;
- if ($display == "none") $dm = 1;
- else if ($display == "ik") $dm = 2;
- else if ($display == "fk") $dm = 3;
- radioButtonGrp -edit -select $dm ikfkDisplay;
-
- }
-
- global proc prefsUpdateAnimDisplay()
- {
- global string $gPreferenceWindow;
- setParent $gPreferenceWindow;
- string $parent = "prefAnimDispCol";
- if (`columnLayout -q -numberOfChildren $parent` == 0) return;
-
- intSliderGrp -e
- -v (`optionVar -q ghostFramesBefore`) ghostFramesBeforeSlider;
- intSliderGrp -e
- -v (`optionVar -q ghostFramesAfter`) ghostFramesAfterSlider;
- intSliderGrp -e
- -v (`optionVar -q ghostFrameStep`) ghostFrameStepSlider;
- }
-
- global proc prefsUpdateManips()
- {
- global string $gPreferenceWindow;
- setParent $gPreferenceWindow;
-
- string $parent = "prefManipsCol";
- if (`columnLayout -q -numberOfChildren $parent` == 0) return;
-
- optionMenuGrp -edit
- -select `optionVar -query defaultShowManipulator`
- defaultManipOpts;
-
- floatSliderGrp -e -v `optionVar -q manipGlobalScale` manipScale;
- floatSliderGrp -e -v `optionVar -q manipHandleSize` manipHS;
- intSliderGrp -e -v `optionVar -q manipLineSize` manipLS;
- floatSliderGrp -e -v `optionVar -q manipLinePickSize` manipLP;
- floatSliderGrp -e -v `optionVar -q manipPreviousStateSize` manipPS;
- }
-
-
- global proc prefsUpdateNURBS()
- {
- global string $gPreferenceWindow;
- setParent $gPreferenceWindow;
- string $parent = "prefNURBSCol";
- if (`columnLayout -q -numberOfChildren $parent` == 0) return;
-
- int $hasSurfaces = `isTrue SurfaceUIExists`;
-
- checkBoxGrp -e
- -value1 `optionVar -query newCurveDisplayEP`
- -value2 `optionVar -query newCurveDisplayHull`
- -value3 `optionVar -query newCurveDisplayCV`
- controlCBG1;
-
- if ( $hasSurfaces ) {
- checkBoxGrp -e
- -value1 `optionVar -query newSurfaceDisplayEP`
- -value2 `optionVar -query newSurfaceDisplayHull`
- controlNewSurface1;
-
- checkBoxGrp -e
- -value1 `optionVar -query newSurfaceDisplayCV`
- -value2 `optionVar -query newSurfaceDisplayOrigin`
- controlNewSurface2;
-
- intSliderGrp -e -v `optionVar -q newNurbsIsoparms` nurbsDivUV;
- intSliderGrp -e -v `optionVar -q newNurbsPointsShaded` nurbsDivS;
- }
- intSliderGrp -e -v `optionVar -q newNurbsPointsWire` nurbsDivW;
-
- displaySmoothness -dc -du `optionVar -q newNurbsIsoparms`;
- displaySmoothness -dc -pw `optionVar -q newNurbsPointsWire`;
- displaySmoothness -dc -ps `optionVar -q newNurbsPointsShaded`;
- }
-
- global proc prefsUpdatePolys()
- {
- global string $gPreferenceWindow;
- setParent $gPreferenceWindow;
- string $parent = "prefPolysCol";
- if (`columnLayout -q -numberOfChildren $parent` == 0) return;
- if (!`isTrue "PolygonsExists"`) return;
-
- checkBoxGrp -e
- -value1 `optionVar -query newPolyVtxDisp`
- -value2 `optionVar -query newPolyVertexNormals`
- -value3 `optionVar -query newPolyVtxBackCull`
- polyVertDispCheck;
-
- radioButtonGrp -e
- -sl (`optionVar -q newPolyEdgeDisp` + 1) polyEdgeDispRadio;
-
- checkBoxGrp -e
- -value1 `optionVar -query newPolyBorderEdgeHilite`
- -value2 `optionVar -query newPolyBorderMapHilite`
- polyBordEdgeHiliteDispCheck;
-
- floatSliderGrp -e
- -v `optionVar -q newPolyBorderEdgeSize` polyBordEdgeSizeSlider;
- polyOptions -np -sb `optionVar -q newPolyBorderEdgeSize`;
-
- checkBoxGrp -e
- -value1 `optionVar -query newPolyFacetCentreDisp`
- -value2 `optionVar -query newPolyFacetNormalDisp`
- polyFacetDispCheck1;
-
- checkBoxGrp -e
- -value1 `optionVar -query newPolyFacetTrngleDisp`
- -value2 `optionVar -query newPolyFacetWarpDisp`
- polyFacetDispCheck2;
-
- checkBoxGrp -e
- -value1 `optionVar -query newPolyNumVertexDisp`
- -value2 `optionVar -query newPolyNumEdgeDisp`
- polyItemDispCheck1;
-
- checkBoxGrp -e
- -value1 `optionVar -query newPolyNumFacetDisp`
- -value2 `optionVar -query newPolyNumUvDisp`
- polyItemDispCheck2;
-
- floatSliderGrp -e
- -v `optionVar -q newPolyNormalSize` polyNormalSizeSlider;
- polyOptions -np -sn `optionVar -q newPolyNormalSize`;
-
- optionMenuGrp -e
- -sl (`optionVar -q newPolyBackFaceCull` + 1) polyFBackCullPopup;
-
- checkBoxGrp -e
- -value1 `optionVar -query newPolyColorShaded` colorShadedDisplayCheck;
- optionMenuGrp -e -sl
- `optionVar -q newPolyColorChannel` colorMaterialPopup;
-
- prefPolyUpdateCulling();
- }
-
- global proc prefsUpdateSettings()
- {
- global string $gPreferenceWindow;
- setParent $gPreferenceWindow;
- string $parent = "prefSettingsCol";
- if (`columnLayout -q -numberOfChildren $parent` == 0) return;
-
- string $type;
- int $which;
-
- // coordinate system
- //
- radioButtonGrp -e
- -sl ((`optionVar -q upAxisDirection` == "y") ? 1 : 2)
- upAxisRBG;
-
- // linear units
- //
- $type = `optionVar -q workingUnitLinear`;
- if ("mm" == $type || "millimeter" == $type) {
- $which = 1;
- } else if ("cm" == $type || "centimeter" == $type) {
- $which = 2;
- } else if ("m" == $type || "meter" == $type) {
- $which = 3;
- // re-number next menus after removing this one
- // } else if ("km" == $type || "kilometer" == $type) {
- // $which = 4;
- } else if ("in" == $type || "inch" == $type) {
- $which = 4;
- } else if ("ft" == $type || "foot" == $type) {
- $which = 5;
- } else if ("yd" == $type || "yard" == $type) {
- $which = 6;
- // } else if ("mi" == $type || "mile" == $type) {
- // $which = 8;
- } else {
- $which = 1;
- }
- optionMenuGrp -e -sl $which linearOpts;
-
- // angular
- //
- $type = `optionVar -q workingUnitAngular`;
- if ("deg" == $type || "degree" == $type) {
- $which = 1;
- } else if ("rad" == $type || "radian" == $type) {
- $which = 2;
- } else {
- $which = 1;
- }
- optionMenuGrp -e -sl $which angularOpts;
-
- // time
- //
- $type = `optionVar -q workingUnitTime`;
- if ("game" == $type) {
- $which = 1;
- } else if ("film" == $type) {
- $which = 2;
- } else if ("pal" == $type) {
- $which = 3;
- } else if ("ntsc" == $type) {
- $which = 4;
- } else if ("show" == $type) {
- $which = 5;
- } else if ("palf" == $type) {
- $which = 6;
- } else if ("ntscf" == $type) {
- $which = 7;
- } else if ("millisec" == $type) {
- $which = 8;
- } else if ("sec" == $type) {
- $which = 9;
- } else if ("min" == $type) {
- $which = 10;
- } else if ("hour" == $type) {
- $which = 11;
- } else {
- $which = 1;
- }
- optionMenuGrp -e -sl $which timeOpts;
-
- // tolerance
- //
- floatSliderGrp -e
- -v `optionVar -q positionalTolerance` posTolFloatSliderGrp;
- floatSliderGrp -e
- -v `optionVar -q tangentialTolerance` tanTolFloatSliderGrp;
- }
-
-
- global proc prefsUpdateAnim()
- {
- global string $gPreferenceWindow;
- global string $gPlayBackSlider;
-
- setParent $gPreferenceWindow;
- string $parent = "prefAnimCol";
- if (`columnLayout -q -numberOfChildren $parent` == 0) return;
-
- int $which;
- int $size;
- string $type;
-
- // Playback Start/End
- //
- floatFieldGrp -e
- -value1 `optionVar -query playbackMin`
- -value2 `optionVar -query playbackMax`
- timeSliderBounds;
-
- // Animation Start/End
- //
- floatFieldGrp -e
- -value1 `optionVar -query playbackMinRange`
- -value2 `optionVar -query playbackMaxRange`
- rangeSliderBounds;
-
- // Height
- //
- $size = `optionVar -q timeSliderHeight`;
- $which = ($size < 30) ? 1 : (($size < 60) ? 2 : 3);
- radioButtonGrp -e -sl $which timeLineSize;
-
- // Key Ticks
- //
- $type = `optionVar -q timeSliderShowKeys`;
- if( $type == "active" ) {
- radioButtonGrp -e -sl 2 showTicks;
- } else if( $type == "none" ) {
- radioButtonGrp -e -sl 1 showTicks;
- } else {
- radioButtonGrp -e -sl 3 showTicks;
- }
-
- // Options: Timecode, Snapping
- //
- checkBoxGrp -e
- -value1 `optionVar -query timeSliderTimeCode`
- -value2 `optionVar -query timeSliderSnapping`
- timeLine;
-
- // Timecode Offset
- //
- textFieldGrp -e
- -enable `optionVar -q timeSliderTimeCode`
- -text `optionVar -q timeSliderTimeCodeOffset`
- timeCodeOffset;
-
- // Update View
- //
- radioButtonGrp -e
- -sl (("active" == `optionVar -q timeSliderPlayView`) ? 1 : 2)
- playbackView;
-
- // Looping
- //
- $type = `optionVar -q timeSliderPlayLoop`;
- $which = ($type == "once") ? 1 : (($type == "oscillate") ? 2 : 3);
- radioButtonGrp -e -sl $which playbackLooping;
-
- // Playback Speed
- //
- float $speed = `optionVar -query timeSliderPlaySpeed`;
- if ($speed == 1.0) {
- $which = 2;
- } else if ($speed == 0.5) {
- $which = 3;
- } else if ($speed == 2.0) {
- $which = 4;
- } else if ($speed == 0.0) {
- $which = 1;
- } else {
- $which = 5;
- }
-
- optionMenu -e -sl $which speedOpts;
- text -edit -enable ($which == 5) playbackSpeedT;
-
- floatField -edit
- -enable ($which == 5)
- -value $speed
- playbackSpeedFF;
-
- // Playback By: value only applicable if the speed is
- // "free" ($which == 1)
- //
- floatField -e -v `optionVar -q timeSliderPlayBy` playbackByFF;
- rowLayout -edit -enable ($which == 1) playbackByRow;
- }
-
- global proc prefsUpdateDyn()
- {
- global string $gPreferenceWindow;
- setParent $gPreferenceWindow;
- string $parent = "prefDynCol";
- if (`columnLayout -q -numberOfChildren $parent` == 0) return;
- if (!`isTrue "DynamicsExists"`) return;
-
- checkBoxGrp -e -v1 (`optionVar -q dynPrefAutoCreate`)
- dynAutoCreate;
-
- checkBoxGrp -e -v1 (`optionVar -q dynPrefRunupToCurrentTime`)
- dynRunupToCurrentTime;
-
- radioButtonGrp -e -select (`optionVar -q dynPrefRunupFrom`)
- dynRunupFrom;
-
- checkBoxGrp -e -v1 (`optionVar -q dynPrefSaveRuntimeState`)
- dynSaveRuntimeState;
-
- // Enable the dynRunupFrom radioButtonoGrp only if
- // dynRunupToCurrentTime is on.
- //
- int $state = `checkBoxGrp -q -v1 dynRunupToCurrentTime`;
- radioButtonGrp -e -enable $state dynRunupFrom;
- }
-
- global proc prefsUpdateKeys()
- {
- global string $gPreferenceWindow;
- setParent $gPreferenceWindow;
- string $parent = "prefKeysCol";
- if (`columnLayout -q -numberOfChildren $parent` == 0) return;
-
- // Auto Key
- //
- int $autoKeyVal = `optionVar -q autoKeyframeState`;
- checkBoxGrp -e -v1 $autoKeyVal autoKey;
- string $characterAutoKey = `optionVar -q autoKeyCharacterState`;
- int $which = 1;
- if ($characterAutoKey == "all") {
- $which = 2;
- }
- optionMenuGrp -e -select $which -enable $autoKeyVal autoKeyCharacter;
-
- optionMenuGrp -edit
- -select `optionVar -query rotationInterpolationDefault`
- rotationInterpolationDefaultOptions;
-
- // Weighted Tangents
- //
- int $weighted = `optionVar -q weightedTangents`;
- checkBoxGrp -e -v1 $weighted weightedTangents;
-
- // Default in tangent
- //
- string $tangentType = `optionVar -q inTangentType`;
- $which = 1;
- if ($tangentType == "spline") {
- $which = 1;
- } else if ($tangentType == "linear") {
- $which = 2;
- } else if ($tangentType == "clamped") {
- $which = 3;
- } else if ($tangentType == "flat") {
- $which = 4;
- }
- optionMenuGrp -edit -select $which inTangentType;
-
- // Default out tangent
- //
- $tangentType = `optionVar -q outTangentType`;
- $which = 1;
- if ($tangentType == "spline") {
- $which = 1;
- } else if ($tangentType == "linear") {
- $which = 2;
- } else if ($tangentType == "clamped") {
- $which = 3;
- } else if ($tangentType == "flat") {
- $which = 4;
- } else if ($tangentType == "step") {
- $which = 5;
- }
- optionMenuGrp -edit -select $which outTangentType;
- }
-
- global proc prefsUpdateModeling()
- {
- global string $gPreferenceWindow;
- setParent $gPreferenceWindow;
- string $parent = "prefModelingCol";
- if (`columnLayout -q -numberOfChildren $parent` == 0) return;
-
- int $curType = `modelWithType -1`;
- if ($curType == 0) {
- radioButtonGrp -e -sl 1 modelWithType1;
- radioButtonGrp -e -enable 0 modelWithType5;
- } else if ($curType == 1) {
- radioButtonGrp -e -sl 1 modelWithType2;
- radioButtonGrp -e -enable 0 modelWithType5;
- } else if ($curType == 3) {
- radioButtonGrp -e -sl 1 modelWithType3;
- radioButtonGrp -e -enable 0 modelWithType5;
- } else if ($curType == 2) {
- radioButtonGrp -e -sl 1 modelWithType4;
- radioButtonGrp -e -enable 0 modelWithType5;
- } else if ($curType == -1) {
- radioButtonGrp -e -sl 1 -enable 1 modelWithType5;
- }
-
- $curType = `modelWithToolsAll -1`;
- if ($curType == 0) {
- radioButtonGrp -e -sl 1 modelWithTools2;
- radioButtonGrp -e -enable 0 modelWithTools3;
- } else if ($curType == 1) {
- radioButtonGrp -e -sl 1 modelWithTools1;
- radioButtonGrp -e -enable 0 modelWithTools3;
- } else if ($curType == -1) {
- radioButtonGrp -e -sl 1 -enable 1 modelWithTools3;
- }
- }
-
- global proc prefsUpdateSelect()
- {
- global int $gCustomSelPriority[];
- global string $gSelectPriorityMode;
- global string $gPreferenceWindow;
- setParent $gPreferenceWindow;
- string $parent = "prefSelectCol";
- if (`columnLayout -q -numberOfChildren $parent` == 0) return;
-
- checkBoxGrp -e
- -value1 `optionVar -query selectSingleMarquee`
- -value2 `optionVar -query selectClickDrag`
- modsCBG1;
- checkBoxGrp -e
- -value1 `optionVar -query selectAffectsActive`
- -value2 `optionVar -query popupMenuSelection`
- modsCBG2;
- checkBoxGrp -e
- -value1 `optionVar -query ignoreSelectionPriority`
- -value2 `optionVar -query expandPopupList`
- modsCBG3;
-
- intSliderGrp -e
- -v `optionVar -q clickBoxSize`
- clickBoxSizeS;
-
- if (`isTrue "PolygonsExists"`) {
- radioButtonGrp -e
- -sl (`optionVar -q polyFaceSensitive` ? 2 : 1)
- polyFaceSensitiveRadio;
- }
-
- $gSelectPriorityMode = `optionVar -q selectPrefPriorityMode`;
-
- if ("custom" == $gSelectPriorityMode) {
- optionMenu -e -sl 1 presetOpts;
- intFieldGrp -e -en true priorVal;
- } else if ("animation" == $gSelectPriorityMode) {
- optionMenu -e -sl 2 presetOpts;
- intFieldGrp -e -en false priorVal;
- } else if ("nurbs" == $gSelectPriorityMode) {
- optionMenu -e -sl 3 presetOpts;
- intFieldGrp -e -en false priorVal;
- } else if ("rendering" == $gSelectPriorityMode) {
- optionMenu -e -sl 4 presetOpts;
- intFieldGrp -e -en false priorVal;
- } else if ("dynamics" == $gSelectPriorityMode) {
- optionMenu -e -sl 5 presetOpts;
- intFieldGrp -e -en false priorVal;
- }
-
- $gCustomSelPriority = `optionVar -q customSelectPriority`;
- selPriority( $gSelectPriorityMode );
-
- textScrollList -e -da -sii 1 priorList;
- prefSelectPriorListChanged;
- }
-
- global proc prefsUpdateSnap()
- {
- global string $gPreferenceWindow;
- setParent $gPreferenceWindow;
- string $parent = "prefSnapCol";
- if (`columnLayout -q -numberOfChildren $parent` == 0) return;
-
- checkBoxGrp -e
- -value1 `optionVar -query useSnapTolerance`
- useSnapCBG1;
-
- intSliderGrp -e
- -v `optionVar -q snapTolerance`
- snapToleranceSG;
-
- intSliderGrp -e
- -v `optionVar -q snapUVTolerance`
- snapUVToleranceSG;
-
- intSliderGrp -e
- -v `optionVar -q snapMagnet`
- snapMagnetSG;
-
- floatSliderGrp -e
- -v `optionVar -q snapMagnetTolerance`
- snapMagnetToleranceSG;
- }
-
- global proc prefsUpdateSound()
- {
- global string $gPreferenceWindow;
- setParent $gPreferenceWindow;
- string $parent = "prefSoundCol";
- if (`columnLayout -q -numberOfChildren $parent` == 0) return;
-
- // Waveform display
- //
- string $waveform = `optionVar -q timeSliderSoundDisplay` ;
- if( $waveform == "bottom" ) {
- radioButtonGrp -e -sl 2 soundDisplay;
- } else if( $waveform == "both" ) {
- radioButtonGrp -e -sl 3 soundDisplay;
- } else {
- radioButtonGrp -e -sl 1 soundDisplay;
- }
-
- // Repeat on Hold
- //
- int $doRepeat = `optionVar -q timeSliderRepeatOnHold` ;
- checkBoxGrp -e -v1 $doRepeat soundRepeat;
-
- // Repeat Size
- //
- float $chunk = `optionVar -q timeSliderRepeatChunk`;
- int $canDisplayChunk = ( $chunk == 1.0 || $chunk == 2.0 ||
- $chunk == 3.0 );
-
- rowLayout -e -enable $doRepeat soundRepeatChunkLayout;
- floatField -e -value $chunk soundRepeatChunkValue;
-
- if( $canDisplayChunk ) {
- radioButton -e -sl ( "soundRepeatChunk" + int( $chunk ) );
- } else {
- radioButton -e -sl "soundRepeatChunk4";
- }
- }
-
- global proc prefsUpdateAdvanced()
- {
- global string $gPreferenceWindow;
- setParent $gPreferenceWindow;
- string $parent = "prefAdvancedCol";
- if (`columnLayout -q -numberOfChildren $parent` == 0) return;
-
- // undo
- int $isInfinite = `optionVar -q undoIsInfinite`;
- radioButtonGrp -e
- -sl (`optionVar -q undoIsEnabled` == on ? 1 : 2)
- undoEnableRBG;
- radioButtonGrp -e
- -sl ($isInfinite ? 1 : 2)
- queueLimitRBG;
- intFieldGrp -e
- -enable (!$isInfinite)
- -value1 `optionVar -query undoLength`
- queueSizeIFG;
- }
-
- // Description: Update the rendering pref UI to reflect
- // the current status of the option variables
- // Returns: None
- //
- global proc prefsUpdateRendering()
- {
- global string $gPreferenceWindow;
- setParent $gPreferenceWindow;
- string $parent = "prefRenderingCol";
- if (`columnLayout -q -numberOfChildren $parent` == 0) return;
-
- string $prefRen = "mayaSoftware";
-
- if (`optionVar -exists preferredRenderer`)
- {
- $prefRen = `optionVar -q preferredRenderer`;
- }
-
- if (!`renderer -exists $prefRen`)
- {
- $prefRen = "mayaSoftware";
- }
-
- // Update the Renderer selection option box to reflect current renderer
- //
- string $renderers[] = `renderer -query -namesOfAvailableRenderers`;
-
- for ($i = 0; $i < size($renderers); $i += 1)
- {
- if($renderers[$i] == $prefRen)
- {
- optionMenu -edit -select ($i+1) prefRendererOptionMenu;
- }
- }
- }
-
- global proc prefsUpdateFileIO()
- {
- global string $gPreferenceWindow;
- setParent $gPreferenceWindow;
- string $parent = "prefFileIOCol";
- if (`columnLayout -q -numberOfChildren $parent` == 0) return;
-
- // If MAYA_PROJECTS_DIR env var is set, we won't allow
- // this to be set from the UI
- string $envVar = `getenv MAYA_PROJECTS_DIR`;
- if ( size($envVar) > 0 )
- {
- textField -e -ed false -tx $envVar projectsDir;
- button -e -en false projectsDirBrowser;
- }
- else
- {
- if ( `optionVar -ex ProjectsDir` )
- {
- textField -e -tx `optionVar -q ProjectsDir` projectsDir;
- }
- }
-
- // Same for MAYA_PROJECT
- string $envVar = `getenv MAYA_PROJECT`;
- if ( size($envVar) > 0 )
- {
- textField -e -ed false -tx $envVar initialProject;
- button -e -en false initialProjectBrowser;
- }
- else
- {
- if ( `optionVar -ex InitialProject` )
- {
- textField -e -tx `optionVar -q InitialProject` initialProject;
- }
- }
-
- // recent files maximum history size
- intSliderGrp -e -v `optionVar -q RecentFilesMaxSize` RecentFilesMaxSize;
-
- // recent backups maximum history size
- intSliderGrp -e -v `optionVar -q RecentBackupsMaxSize` RecentBackupsMaxSize;
-
- // recent projects maximum history size
- intSliderGrp -e -v `optionVar -q RecentProjectsMaxSize` RecentProjectsMaxSize;
-
- // file save compression
- string $mode = `optionVar -q fileCompressionMode`;
- if ("compressed" == $mode) {
- radioButtonGrp -e -sl 1 compressionRBG;
- } else if ("uncompressed" == $mode) {
- radioButtonGrp -e -sl 2 compressionRBG;
- } else {
- radioButtonGrp -e -sl 3 compressionRBG;
- }
-
- // Display Layers
- radioButtonGrp -e
- -sl (`optionVar -q displayLayerMerge` + 1)
- layerMerge;
- }
-
- global proc prefsUpdateModules()
- {
- global string $gPreferenceWindow;
- setParent $gPreferenceWindow;
- string $parent = "prefModulesCol";
- if (`columnLayout -q -numberOfChildren $parent` == 0) return;
-
- checkBoxGrp -e
- -value1 `optionVar -query loadDynamics`
- packCBG1;
-
- checkBoxGrp -e
- -value1 `optionVar -query loadUrchin`
- packCBG8;
- }
-
- global proc prefsUpdateOpenMaya()
- {
- global string $gPreferenceWindow;
- setParent $gPreferenceWindow;
- string $parent = "prefOpenMayaCol";
-
- // openMaya prefs are not available on NT
- if (`about -nt`) return;
-
- if (`columnLayout -q -numberOfChildren $parent` == 0) return;
-
- radioButtonGrp -e
- -sl (`optionVar -q apiPrefLazyLoading` ? 1 : 2)
- lazyLoadingCheck;
-
- radioButtonGrp -e
- -sl (`optionVar -q apiPrefOldPluginWarning` ? 1 : 2)
- oldPluginWarningCheck;
- }
-